package com.ffapp.rainmonitorcustom.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

public class ProjectListBean extends BaseListBeanBc {

    @JSONField(name = "data")
    private ArrayList<ProjectListData> list = new ArrayList<ProjectListData>();

    public ArrayList<ProjectListData> getList() {
        return list;
    }

    public void setList(ArrayList<ProjectListData> list) {
        this.list = list;
    }

    public void addListBean(ProjectListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrentPage() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<ProjectListData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public void changeLike(int position){
        if(position >= list.size())return;
        ProjectListData data = list.get(position);
        data.setIs_like(data.getIs_likeBoolean()?0:1);
    }
}
